function renderNavbar(pathname) {
    //数据
    let arr = [{
            title: '跑步',
            path: './run.html'
        },
        {
            title: '骑行',
            path: './ride.html'
        },
        {
            title: '课程训练',
            path: './course.html'
        }
    ]

    //模板
    let html = `
        ${arr.map(v=>{
            return `<a href="${v.path}" class="item df jcc aic ${
                v.path === `./${pathname}.html` && 'active'
              }">${v.title}</a>`
        }).join('')}
    `
        //创建div
        let div = document.createElement('div');
        //设置div的class
        div.className = 'navbar df jcsa aic';
        //给div填充内容
        div.innerHTML = html;
        //body将div添加到最后
        document.body.prepend(div);
}

//导出渲染函数
module.exports = renderNavbar